<?php
class adm_user_region_model extends ci_model {


	public function __construct(){
		parent::__construct();
		$this->db = $this->load->database('default',true);
	}

	public function add_user_region($user_id,$region_id) {
		$data=array("user_id"	=>$user_id,
				"region_id"	=>$region_id
		);
		$this->db->insert("adm_user_region",$data);
	}

	public function query_user_region($user_id){
		$sql ="select region_id from adm_user_region where  user_id ='$user_id'";
		$query =$this->db->query($sql);
		if ($query) {
			return $query->result_array();
		}
	}

	public function delete_user_region($user_id){
		$sql ="delete from adm_user_region where  user_id ='$user_id'";
		$query =$this->db->query($sql);
	}
}